package web_model

import (
	"github.com/shopspring/decimal"
	"time"

	"gorm.io/gorm"
)

const TableNameTransCar = "trans_car"

// TransCar mapped from table <trans_car>
type TransCar struct {
	ID          int64           `gorm:"column:id;type:INTEGER;primaryKey" json:"id"`
	Sn          string          `gorm:"column:sn;type:TEXT" json:"sn"`
	Brand       string          `gorm:"column:brand;type:TEXT" json:"brand"`
	Model       string          `gorm:"column:model;type:TEXT" json:"model"`
	GpsDeviceID string          `gorm:"column:gps_device_id;type:TEXT" json:"gps_device_id"`
	ThmsIds     string          `gorm:"column:thms_ids;type:TEXT" json:"thms_ids"`
	Type        string          `gorm:"column:type;type:char" json:"type"`
	Lng         decimal.Decimal `gorm:"column:lng;type:decimal(10,8)" json:"lng"`
	Lat         decimal.Decimal `gorm:"column:lat;type:decimal(10,8)" json:"lat"`
	Status      string          `gorm:"column:status;type:char" json:"status"`
	CreatedAt   time.Time       `gorm:"column:created_at;type:DATETIME" json:"created_at"`
	UpdatedAt   time.Time       `gorm:"column:updated_at;type:DATETIME" json:"updated_at"`
	DeletedAt   gorm.DeletedAt  `gorm:"column:deleted_at;type:DATETIME" json:"deleted_at"`
	CreatedBy   string          `gorm:"column:created_by;type:TEXT" json:"created_by"`
	UpdatedBy   string          `gorm:"column:updated_by;type:text" json:"updated_by"`
}

// TableName TransCar's table name
func (*TransCar) TableName() string {
	return TableNameTransCar
}
